import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
/**
 * Write a description of class Vidas here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Vidas extends Actor
{

    int vidas;
    /**
     * An example of a method - replace this comment with your own
     *
     * @param  y   a sample parameter for a method
     * @return     the sum of x and y
     */
    public Vidas()
    {
        vidas=3;
        this.setImage(new GreenfootImage(
                          ""+vidas+"",30,Color.WHITE,Color.BLACK));
    }

    /**
     * Act - do whatever the Vidas wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
    }
    
    
    /**
     * An example of a method - replace this comment with your own
     *
     * @param  y   a sample parameter for a method
     * @return     the sum of x and y
     */
    public void cambiaVidas()
    {
            vidas--;
             this.setImage(new GreenfootImage(
                          ""+vidas+"",30,Color.WHITE,Color.BLACK));

    }

}
